

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
    <style>
    /* base */
    html,
    body,
    .container {
      width: 100%;
      height: 100%;
    }

    a,
    a:link,
    a:visited {
      text-decoration: none;
      color: inherit;
    }

    ul {
      list-style: none;
    }

    *,
    ::before,
    ::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    *:focus {
      outline: 0;
    }

    .container {
      display: flex;
      padding-top: 20px;
    }

    /* Nav */
    .container .doc-nav {
      position: fixed;
      height: 100%;
      margin: 0 30px 0 40px;
      width: 280px;
    }

    .doc-nav .nav-header {
      display: flex;
      align-items: center;
      box-sizing: border-box;
      background-color: rgb(240, 241, 242);
      height: 40px;
      padding: 16px;
      font-size: 18px;
      font-weight: 500;
      color: rgb(62, 64, 66);
      cursor: pointer;
    }

    .doc-nav .nav-content {
      height: calc(100% - 40px);
      overflow-y: auto;
      color: rgb(32, 34, 36);
    }

    .doc-nav .nav-content .nav-list,
    .doc-nav .nav-content .nav-sub-list {
      line-height: 1.5rem;
    }

    .doc-nav .nav-content .nav-label {
      display: inline-block;
      position: relative;
      padding: 2px 0 2px 20px;
      margin-bottom: 4px;
    }

    .doc-nav .nav-content .nav-sub-label {
      position: relative;
      padding: 2px 0 2px 40px;
      font-size: 14px;
    }

    .doc-nav .nav-content .nav-sub-label:hover {
      text-decoration: underline;
    }

    .doc-nav .nav-content .nav-list .nav-label.group::before {
      border-bottom: 0.25rem solid transparent;
      border-left: 0.25rem solid #6e7072;
      border-right: 0;
      border-top: 0.25rem solid transparent;
      content: '';
      display: block;
      height: 0;
      left: 0.5rem;
      position: absolute;
      top: 0.625rem;
      transition: transform 0.1s linear;
      width: 0;
    }

    .doc-nav .nav-content .nav-list .nav-label.group.active::before {
      transform: rotate(90deg);
    }

    /* doc content */
    .container .doc-content {
      position: fixed;
      height: 100%;
      width: calc(100% - 80px - 40px - 30px - 240px);
      right: 0%;
      overflow-y: auto;
    }

    .doc-title {
      border-bottom: 1px solid #dcdee0;
      font-size: 22px;
      margin: 8px 0 0;
      padding-bottom: 16px;
    }

    .doc-content h3 {
      font-size: 24px;
      font-weight: 600;
      margin: 24px 0;
    }

    .doc-content h4 {
      font-size: 22px;
      font-weight: 500;
      margin: 30px 0 8px;
    }

    .doc-content h4 span {
      color: #007d9c;
    }

    .doc-content .doc-declare {
      background-color: #fafafa;
      border-radius: 5px;
      border: 1px solid #ccc;
      font-size: 14px;
      overflow-x: auto;
      padding: 10px;
      tab-size: 4;
      line-height: 20px;
    }

    .doc-content .doc-comment {
      font-size: 16px;
      margin: 16px 0;
      line-height: 24px;
      word-break: break-word;
    }
  </style>

</head>
<body>
  <div class="container">
    <div class="doc-nav">
      <a href="#Documentation" class="nav-header">Documentation</a>
      <nav class="nav-content">
        <ul class="nav-list">
          <li>
            <a href="#includes" class="nav-label">Includes</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#config.h" class="nav-sub-label">config.h</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_CONFIG_FILE" class="nav-sub-label">MBEDTLS_CONFIG_FILE</a>
              </li>
      

              <li>
                <a href="#ssl.h" class="nav-sub-label">ssl.h</a>
              </li>
      

              <li>
                <a href="#cipher.h" class="nav-sub-label">cipher.h</a>
              </li>
      

              <li>
                <a href="#md5.h" class="nav-sub-label">md5.h</a>
              </li>
      

              <li>
                <a href="#sha1.h" class="nav-sub-label">sha1.h</a>
              </li>
      

              <li>
                <a href="#sha256.h" class="nav-sub-label">sha256.h</a>
              </li>
      

              <li>
                <a href="#sha512.h" class="nav-sub-label">sha512.h</a>
              </li>
      

              <li>
                <a href="#ecjpake.h" class="nav-sub-label">ecjpake.h</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#macros" class="nav-label">Macros</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#MBEDTLS_SSL_INTERNAL_H" class="nav-sub-label">MBEDTLS_SSL_INTERNAL_H</a>
              </li>
      

              <li>
                <a href="#inline" class="nav-sub-label">inline</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MIN_MAJOR_VERSION" class="nav-sub-label">MBEDTLS_SSL_MIN_MAJOR_VERSION</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MIN_MINOR_VERSION" class="nav-sub-label">MBEDTLS_SSL_MIN_MINOR_VERSION</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MIN_MINOR_VERSION" class="nav-sub-label">MBEDTLS_SSL_MIN_MINOR_VERSION</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MIN_MINOR_VERSION" class="nav-sub-label">MBEDTLS_SSL_MIN_MINOR_VERSION</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MIN_MINOR_VERSION" class="nav-sub-label">MBEDTLS_SSL_MIN_MINOR_VERSION</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MIN_VALID_MINOR_VERSION" class="nav-sub-label">MBEDTLS_SSL_MIN_VALID_MINOR_VERSION</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MIN_VALID_MAJOR_VERSION" class="nav-sub-label">MBEDTLS_SSL_MIN_VALID_MAJOR_VERSION</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MAX_MAJOR_VERSION" class="nav-sub-label">MBEDTLS_SSL_MAX_MAJOR_VERSION</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MAX_MINOR_VERSION" class="nav-sub-label">MBEDTLS_SSL_MAX_MINOR_VERSION</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MAX_MINOR_VERSION" class="nav-sub-label">MBEDTLS_SSL_MAX_MINOR_VERSION</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MAX_MINOR_VERSION" class="nav-sub-label">MBEDTLS_SSL_MAX_MINOR_VERSION</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MAX_MINOR_VERSION" class="nav-sub-label">MBEDTLS_SSL_MAX_MINOR_VERSION</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL__ECP_RESTARTABLE" class="nav-sub-label">MBEDTLS_SSL__ECP_RESTARTABLE</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_INITIAL_HANDSHAKE" class="nav-sub-label">MBEDTLS_SSL_INITIAL_HANDSHAKE</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS" class="nav-sub-label">MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_RENEGOTIATION_DONE" class="nav-sub-label">MBEDTLS_SSL_RENEGOTIATION_DONE</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_RENEGOTIATION_PENDING" class="nav-sub-label">MBEDTLS_SSL_RENEGOTIATION_PENDING</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_RETRANS_PREPARING" class="nav-sub-label">MBEDTLS_SSL_RETRANS_PREPARING</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_RETRANS_SENDING" class="nav-sub-label">MBEDTLS_SSL_RETRANS_SENDING</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_RETRANS_WAITING" class="nav-sub-label">MBEDTLS_SSL_RETRANS_WAITING</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_RETRANS_FINISHED" class="nav-sub-label">MBEDTLS_SSL_RETRANS_FINISHED</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_COMPRESSION_ADD" class="nav-sub-label">MBEDTLS_SSL_COMPRESSION_ADD</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_COMPRESSION_ADD" class="nav-sub-label">MBEDTLS_SSL_COMPRESSION_ADD</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MAC_ADD" class="nav-sub-label">MBEDTLS_SSL_MAC_ADD</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MAC_ADD" class="nav-sub-label">MBEDTLS_SSL_MAC_ADD</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MAC_ADD" class="nav-sub-label">MBEDTLS_SSL_MAC_ADD</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MAC_ADD" class="nav-sub-label">MBEDTLS_SSL_MAC_ADD</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_PADDING_ADD" class="nav-sub-label">MBEDTLS_SSL_PADDING_ADD</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_PADDING_ADD" class="nav-sub-label">MBEDTLS_SSL_PADDING_ADD</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_PAYLOAD_OVERHEAD" class="nav-sub-label">MBEDTLS_SSL_PAYLOAD_OVERHEAD</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_IN_PAYLOAD_LEN" class="nav-sub-label">MBEDTLS_SSL_IN_PAYLOAD_LEN</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_OUT_PAYLOAD_LEN" class="nav-sub-label">MBEDTLS_SSL_OUT_PAYLOAD_LEN</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_MAX_BUFFERED_HS" class="nav-sub-label">MBEDTLS_SSL_MAX_BUFFERED_HS</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_TLS_EXT_ADV_CONTENT_LEN" class="nav-sub-label">MBEDTLS_TLS_EXT_ADV_CONTENT_LEN</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_HEADER_LEN" class="nav-sub-label">MBEDTLS_SSL_HEADER_LEN</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_IN_BUFFER_LEN" class="nav-sub-label">MBEDTLS_SSL_IN_BUFFER_LEN</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_OUT_BUFFER_LEN" class="nav-sub-label">MBEDTLS_SSL_OUT_BUFFER_LEN</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_SSL_COMPRESS_BUFFER_LEN" class="nav-sub-label">MBEDTLS_SSL_COMPRESS_BUFFER_LEN</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT" class="nav-sub-label">MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_TLS_EXT_ECJPAKE_KKPP_OK" class="nav-sub-label">MBEDTLS_TLS_EXT_ECJPAKE_KKPP_OK</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#functions" class="nav-label">Functions</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#mbedtls_ssl_sig_hash_set_add" class="nav-sub-label">mbedtls_ssl_sig_hash_set_add</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_sig_hash_set_const_hash" class="nav-sub-label">mbedtls_ssl_sig_hash_set_const_hash</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_transform_free" class="nav-sub-label">mbedtls_ssl_transform_free</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_handshake_free" class="nav-sub-label">mbedtls_ssl_handshake_free</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_handshake_client_step" class="nav-sub-label">mbedtls_ssl_handshake_client_step</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_handshake_server_step" class="nav-sub-label">mbedtls_ssl_handshake_server_step</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_handshake_wrapup" class="nav-sub-label">mbedtls_ssl_handshake_wrapup</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_send_fatal_handshake_failure" class="nav-sub-label">mbedtls_ssl_send_fatal_handshake_failure</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_reset_checksum" class="nav-sub-label">mbedtls_ssl_reset_checksum</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_derive_keys" class="nav-sub-label">mbedtls_ssl_derive_keys</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_handle_message_type" class="nav-sub-label">mbedtls_ssl_handle_message_type</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_prepare_handshake_record" class="nav-sub-label">mbedtls_ssl_prepare_handshake_record</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_update_handshake_status" class="nav-sub-label">mbedtls_ssl_update_handshake_status</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_read_record" class="nav-sub-label">mbedtls_ssl_read_record</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_fetch_input" class="nav-sub-label">mbedtls_ssl_fetch_input</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_write_handshake_msg" class="nav-sub-label">mbedtls_ssl_write_handshake_msg</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_write_record" class="nav-sub-label">mbedtls_ssl_write_record</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_flush_output" class="nav-sub-label">mbedtls_ssl_flush_output</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_parse_certificate" class="nav-sub-label">mbedtls_ssl_parse_certificate</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_write_certificate" class="nav-sub-label">mbedtls_ssl_write_certificate</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_parse_change_cipher_spec" class="nav-sub-label">mbedtls_ssl_parse_change_cipher_spec</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_write_change_cipher_spec" class="nav-sub-label">mbedtls_ssl_write_change_cipher_spec</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_parse_finished" class="nav-sub-label">mbedtls_ssl_parse_finished</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_write_finished" class="nav-sub-label">mbedtls_ssl_write_finished</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_optimize_checksum" class="nav-sub-label">mbedtls_ssl_optimize_checksum</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_psk_derive_premaster" class="nav-sub-label">mbedtls_ssl_psk_derive_premaster</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_set_calc_verify_md" class="nav-sub-label">mbedtls_ssl_set_calc_verify_md</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_check_curve" class="nav-sub-label">mbedtls_ssl_check_curve</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_check_sig_hash" class="nav-sub-label">mbedtls_ssl_check_sig_hash</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_check_cert_usage" class="nav-sub-label">mbedtls_ssl_check_cert_usage</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_write_version" class="nav-sub-label">mbedtls_ssl_write_version</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_read_version" class="nav-sub-label">mbedtls_ssl_read_version</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_send_flight_completed" class="nav-sub-label">mbedtls_ssl_send_flight_completed</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_recv_flight_completed" class="nav-sub-label">mbedtls_ssl_recv_flight_completed</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_resend" class="nav-sub-label">mbedtls_ssl_resend</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_flight_transmit" class="nav-sub-label">mbedtls_ssl_flight_transmit</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_dtls_replay_check" class="nav-sub-label">mbedtls_ssl_dtls_replay_check</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_dtls_replay_update" class="nav-sub-label">mbedtls_ssl_dtls_replay_update</a>
              </li>
      

              <li>
                <a href="#return" class="nav-sub-label">return</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_get_key_exchange_md_ssl_tls" class="nav-sub-label">mbedtls_ssl_get_key_exchange_md_ssl_tls</a>
              </li>
      

              <li>
                <a href="#mbedtls_ssl_get_key_exchange_md_tls1_2" class="nav-sub-label">mbedtls_ssl_get_key_exchange_md_tls1_2</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#vars" class="nav-label">Vars</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#ecrs_n" class="nav-sub-label">ecrs_n</a>
              </li>
      

              <li>
                <a href="#out_msg_seq" class="nav-sub-label">out_msg_seq</a>
              </li>
      

              <li>
                <a href="#in_msg_seq" class="nav-sub-label">in_msg_seq</a>
              </li>
      

              <li>
                <a href="#char" class="nav-sub-label">char</a>
              </li>
      

              <li>
                <a href="#char" class="nav-sub-label">char</a>
              </li>
      

              <li>
                <a href="#retransmit_timeout" class="nav-sub-label">retransmit_timeout</a>
              </li>
      

              <li>
                <a href="#char" class="nav-sub-label">char</a>
              </li>
      

              <li>
                <a href="#flight" class="nav-sub-label">flight</a>
              </li>
      

              <li>
                <a href="#cur_msg" class="nav-sub-label">cur_msg</a>
              </li>
      

              <li>
                <a href="#char" class="nav-sub-label">char</a>
              </li>
      

              <li>
                <a href="#in_flight_start_seq" class="nav-sub-label">in_flight_start_seq</a>
              </li>
      

              <li>
                <a href="#alt_transform_out" class="nav-sub-label">alt_transform_out</a>
              </li>
      

              <li>
                <a href="#char" class="nav-sub-label">char</a>
              </li>
      

              <li>
                <a href="#uint16_t" class="nav-sub-label">uint16_t</a>
              </li>
      

              <li>
                <a href="#mbedtls_md5_context" class="nav-sub-label">mbedtls_md5_context</a>
              </li>
      

              <li>
                <a href="#mbedtls_sha1_context" class="nav-sub-label">mbedtls_sha1_context</a>
              </li>
      

              <li>
                <a href="#mbedtls_sha256_context" class="nav-sub-label">mbedtls_sha256_context</a>
              </li>
      

              <li>
                <a href="#mbedtls_sha512_context" class="nav-sub-label">mbedtls_sha512_context</a>
              </li>
      

              <li>
                <a href="#update_checksum" class="nav-sub-label">update_checksum</a>
              </li>
      

              <li>
                <a href="#calc_verify" class="nav-sub-label">calc_verify</a>
              </li>
      

              <li>
                <a href="#calc_finished" class="nav-sub-label">calc_finished</a>
              </li>
      

              <li>
                <a href="#tls_prf" class="nav-sub-label">tls_prf</a>
              </li>
      

              <li>
                <a href="#pmslen" class="nav-sub-label">pmslen</a>
              </li>
      

              <li>
                <a href="#char" class="nav-sub-label">char</a>
              </li>
      

              <li>
                <a href="#char" class="nav-sub-label">char</a>
              </li>
      

              <li>
                <a href="#resume" class="nav-sub-label">resume</a>
              </li>
      

              <li>
                <a href="#max_major_ver" class="nav-sub-label">max_major_ver</a>
              </li>
      

              <li>
                <a href="#max_minor_ver" class="nav-sub-label">max_minor_ver</a>
              </li>
      

              <li>
                <a href="#cli_exts" class="nav-sub-label">cli_exts</a>
              </li>
      

              <li>
                <a href="#new_session_ticket" class="nav-sub-label">new_session_ticket</a>
              </li>
      

              <li>
                <a href="#extended_ms" class="nav-sub-label">extended_ms</a>
              </li>
      

              <li>
                <a href="#async_in_progress" class="nav-sub-label">async_in_progress</a>
              </li>
      

              <li>
                <a href="#user_async_ctx" class="nav-sub-label">user_async_ctx</a>
              </li>
      

              <li>
                <a href="#mbedtls_md_type_t" class="nav-sub-label">mbedtls_md_type_t</a>
              </li>
      

              <li>
                <a href="#char" class="nav-sub-label">char</a>
              </li>
      

              <li>
                <a href="#char" class="nav-sub-label">char</a>
              </li>
      

              <li>
                <a href="#mbedtls_pk_type_t" class="nav-sub-label">mbedtls_pk_type_t</a>
              </li>
      

              <li>
                <a href="#mbedtls_md_type_t" class="nav-sub-label">mbedtls_md_type_t</a>
              </li>
      

              <li>
                <a href="#char" class="nav-sub-label">char</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#consts" class="nav-label">Consts</a>
            
            <ul class="nav-sub-list">
            
            </ul>
            
          </li>
          <li>
            <a href="#types" class="nav-label">Types</a>
            
            <ul class="nav-sub-list">
            
            </ul>
            
          </li>
          <li>
            <a href="#typedefs" class="nav-label">Typedefs</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#mbedtls_ssl_hs_buffer" class="nav-sub-label">mbedtls_ssl_hs_buffer</a>
              </li>
      
            </ul>
            
          </li>
        </ul>
      </nav>
    </div>
    <div class="doc-content">
      <h2 id="Documentation" class="doc-title">Documentation</h2>
      <h3 id="includes">Includes</h3>
      

      <h4 id="config.h"><span>config.h</span></h4>
      <pre class="doc-declare"><code>#include "config.h"
</code></pre>
      <pre class="doc-comment">#include "config.h"
</pre>

      <h4 id="MBEDTLS_CONFIG_FILE"><span>MBEDTLS_CONFIG_FILE</span></h4>
      <pre class="doc-declare"><code>#include MBEDTLS_CONFIG_FILE
</code></pre>
      <pre class="doc-comment">#include MBEDTLS_CONFIG_FILE
</pre>

      <h4 id="ssl.h"><span>ssl.h</span></h4>
      <pre class="doc-declare"><code>#include "ssl.h"
</code></pre>
      <pre class="doc-comment">#include "ssl.h"
</pre>

      <h4 id="cipher.h"><span>cipher.h</span></h4>
      <pre class="doc-declare"><code>#include "cipher.h"
</code></pre>
      <pre class="doc-comment">#include "cipher.h"
</pre>

      <h4 id="md5.h"><span>md5.h</span></h4>
      <pre class="doc-declare"><code>#include "md5.h"
</code></pre>
      <pre class="doc-comment">#include "md5.h"
</pre>

      <h4 id="sha1.h"><span>sha1.h</span></h4>
      <pre class="doc-declare"><code>#include "sha1.h"
</code></pre>
      <pre class="doc-comment">#include "sha1.h"
</pre>

      <h4 id="sha256.h"><span>sha256.h</span></h4>
      <pre class="doc-declare"><code>#include "sha256.h"
</code></pre>
      <pre class="doc-comment">#include "sha256.h"
</pre>

      <h4 id="sha512.h"><span>sha512.h</span></h4>
      <pre class="doc-declare"><code>#include "sha512.h"
</code></pre>
      <pre class="doc-comment">#include "sha512.h"
</pre>

      <h4 id="ecjpake.h"><span>ecjpake.h</span></h4>
      <pre class="doc-declare"><code>#include "ecjpake.h"
</code></pre>
      <pre class="doc-comment">#include "ecjpake.h"
</pre>
      <h3 id="macros">Macros</h3>
      

      <h4 id="MBEDTLS_SSL_INTERNAL_H">Marco <span>MBEDTLS_SSL_INTERNAL_H</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_INTERNAL_H
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="inline">Marco <span>inline</span></h4>
      <pre class="doc-declare"><code>#define inline __inline
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_MIN_MAJOR_VERSION">Marco <span>MBEDTLS_SSL_MIN_MAJOR_VERSION</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MIN_MAJOR_VERSION          MBEDTLS_SSL_MAJOR_VERSION_3
</code></pre>
      <pre class="doc-comment">/* Determine minimum supported version */</pre>

      <h4 id="MBEDTLS_SSL_MIN_MINOR_VERSION">Marco <span>MBEDTLS_SSL_MIN_MINOR_VERSION</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MIN_MINOR_VERSION          MBEDTLS_SSL_MINOR_VERSION_0
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_MIN_MINOR_VERSION">Marco <span>MBEDTLS_SSL_MIN_MINOR_VERSION</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MIN_MINOR_VERSION          MBEDTLS_SSL_MINOR_VERSION_1
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_MIN_MINOR_VERSION">Marco <span>MBEDTLS_SSL_MIN_MINOR_VERSION</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MIN_MINOR_VERSION          MBEDTLS_SSL_MINOR_VERSION_2
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_MIN_MINOR_VERSION">Marco <span>MBEDTLS_SSL_MIN_MINOR_VERSION</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MIN_MINOR_VERSION          MBEDTLS_SSL_MINOR_VERSION_3
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_MIN_VALID_MINOR_VERSION">Marco <span>MBEDTLS_SSL_MIN_VALID_MINOR_VERSION</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MIN_VALID_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_1
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_MIN_VALID_MAJOR_VERSION">Marco <span>MBEDTLS_SSL_MIN_VALID_MAJOR_VERSION</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MIN_VALID_MAJOR_VERSION MBEDTLS_SSL_MAJOR_VERSION_3
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_MAX_MAJOR_VERSION">Marco <span>MBEDTLS_SSL_MAX_MAJOR_VERSION</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MAX_MAJOR_VERSION          MBEDTLS_SSL_MAJOR_VERSION_3
</code></pre>
      <pre class="doc-comment">/* Determine maximum supported version */</pre>

      <h4 id="MBEDTLS_SSL_MAX_MINOR_VERSION">Marco <span>MBEDTLS_SSL_MAX_MINOR_VERSION</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MAX_MINOR_VERSION          MBEDTLS_SSL_MINOR_VERSION_3
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_MAX_MINOR_VERSION">Marco <span>MBEDTLS_SSL_MAX_MINOR_VERSION</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MAX_MINOR_VERSION          MBEDTLS_SSL_MINOR_VERSION_2
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_MAX_MINOR_VERSION">Marco <span>MBEDTLS_SSL_MAX_MINOR_VERSION</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MAX_MINOR_VERSION          MBEDTLS_SSL_MINOR_VERSION_1
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_MAX_MINOR_VERSION">Marco <span>MBEDTLS_SSL_MAX_MINOR_VERSION</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MAX_MINOR_VERSION          MBEDTLS_SSL_MINOR_VERSION_0
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL__ECP_RESTARTABLE">Marco <span>MBEDTLS_SSL__ECP_RESTARTABLE</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL__ECP_RESTARTABLE
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_INITIAL_HANDSHAKE">Marco <span>MBEDTLS_SSL_INITIAL_HANDSHAKE</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_INITIAL_HANDSHAKE          0
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS">Marco <span>MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS  1  /* In progress */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_RENEGOTIATION_DONE">Marco <span>MBEDTLS_SSL_RENEGOTIATION_DONE</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_RENEGOTIATION_DONE         2  /* Done or aborted */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_RENEGOTIATION_PENDING">Marco <span>MBEDTLS_SSL_RENEGOTIATION_PENDING</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_RENEGOTIATION_PENDING      3  /* Requested (server only) */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_RETRANS_PREPARING">Marco <span>MBEDTLS_SSL_RETRANS_PREPARING</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_RETRANS_PREPARING      0
</code></pre>
      <pre class="doc-comment">/*
 * DTLS retransmission states, see RFC 6347 4.2.4
 *
 * The SENDING state is merged in PREPARING for initial sends,
 * but is distinct for resends.
 *
 * Note: initial state is wrong for server, but is not used anyway.
 */</pre>

      <h4 id="MBEDTLS_SSL_RETRANS_SENDING">Marco <span>MBEDTLS_SSL_RETRANS_SENDING</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_RETRANS_SENDING        1
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_RETRANS_WAITING">Marco <span>MBEDTLS_SSL_RETRANS_WAITING</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_RETRANS_WAITING        2
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_RETRANS_FINISHED">Marco <span>MBEDTLS_SSL_RETRANS_FINISHED</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_RETRANS_FINISHED       3
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_COMPRESSION_ADD">Marco <span>MBEDTLS_SSL_COMPRESSION_ADD</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_COMPRESSION_ADD         1024
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_COMPRESSION_ADD">Marco <span>MBEDTLS_SSL_COMPRESSION_ADD</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_COMPRESSION_ADD            0
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_MAC_ADD">Marco <span>MBEDTLS_SSL_MAC_ADD</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MAC_ADD                48 /* SHA-384 used for HMAC */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_MAC_ADD">Marco <span>MBEDTLS_SSL_MAC_ADD</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MAC_ADD                32 /* SHA-256 used for HMAC */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_MAC_ADD">Marco <span>MBEDTLS_SSL_MAC_ADD</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MAC_ADD                20 /* SHA-1   used for HMAC */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_MAC_ADD">Marco <span>MBEDTLS_SSL_MAC_ADD</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MAC_ADD                16
</code></pre>
      <pre class="doc-comment">/* AEAD ciphersuites: GCM and CCM use a 128 bits tag */</pre>

      <h4 id="MBEDTLS_SSL_PADDING_ADD">Marco <span>MBEDTLS_SSL_PADDING_ADD</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_PADDING_ADD           256
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_PADDING_ADD">Marco <span>MBEDTLS_SSL_PADDING_ADD</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_PADDING_ADD             0
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_PAYLOAD_OVERHEAD">Marco <span>MBEDTLS_SSL_PAYLOAD_OVERHEAD</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_PAYLOAD_OVERHEAD ( MBEDTLS_SSL_COMPRESSION_ADD +   \
                                      MBEDTLS_MAX_IV_LENGTH +         \
                                      MBEDTLS_SSL_MAC_ADD +           \
                                      MBEDTLS_SSL_PADDING_ADD         \
                                      )
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_IN_PAYLOAD_LEN">Marco <span>MBEDTLS_SSL_IN_PAYLOAD_LEN</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_IN_PAYLOAD_LEN ( MBEDTLS_SSL_PAYLOAD_OVERHEAD + \
                                    ( MBEDTLS_SSL_IN_CONTENT_LEN ) )
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_OUT_PAYLOAD_LEN">Marco <span>MBEDTLS_SSL_OUT_PAYLOAD_LEN</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_OUT_PAYLOAD_LEN ( MBEDTLS_SSL_PAYLOAD_OVERHEAD + \
                                     ( MBEDTLS_SSL_OUT_CONTENT_LEN ) )
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_MAX_BUFFERED_HS">Marco <span>MBEDTLS_SSL_MAX_BUFFERED_HS</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_MAX_BUFFERED_HS 4
</code></pre>
      <pre class="doc-comment">/* The maximum number of buffered handshake messages. */</pre>

      <h4 id="MBEDTLS_TLS_EXT_ADV_CONTENT_LEN">Marco <span>MBEDTLS_TLS_EXT_ADV_CONTENT_LEN</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_TLS_EXT_ADV_CONTENT_LEN (                           \
       (MBEDTLS_SSL_IN_CONTENT_LEN > MBEDTLS_SSL_OUT_CONTENT_LEN)  \
       ? ( MBEDTLS_SSL_OUT_CONTENT_LEN )                           \
       : ( MBEDTLS_SSL_IN_CONTENT_LEN )                            \
       )
</code></pre>
      <pre class="doc-comment">/* Maximum length we can advertise as our max content length for
   RFC 6066 max_fragment_length extension negotiation purposes
   (the lesser of both sizes, if they are unequal.)
 */</pre>

      <h4 id="MBEDTLS_SSL_HEADER_LEN">Marco <span>MBEDTLS_SSL_HEADER_LEN</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_HEADER_LEN 13
</code></pre>
      <pre class="doc-comment">/* Note: Even though the TLS record header is only 5 bytes
   long, we're internally using 8 bytes to store the
   implicit sequence number. */</pre>

      <h4 id="MBEDTLS_SSL_IN_BUFFER_LEN">Marco <span>MBEDTLS_SSL_IN_BUFFER_LEN</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_IN_BUFFER_LEN \
   ( ( MBEDTLS_SSL_HEADER_LEN ) + ( MBEDTLS_SSL_IN_PAYLOAD_LEN ) )
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_OUT_BUFFER_LEN">Marco <span>MBEDTLS_SSL_OUT_BUFFER_LEN</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_OUT_BUFFER_LEN \
   ( ( MBEDTLS_SSL_HEADER_LEN ) + ( MBEDTLS_SSL_OUT_PAYLOAD_LEN ) )
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_SSL_COMPRESS_BUFFER_LEN">Marco <span>MBEDTLS_SSL_COMPRESS_BUFFER_LEN</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SSL_COMPRESS_BUFFER_LEN (                              \
       ( MBEDTLS_SSL_IN_BUFFER_LEN > MBEDTLS_SSL_OUT_BUFFER_LEN )     \
       ? MBEDTLS_SSL_IN_BUFFER_LEN                                    \
       : MBEDTLS_SSL_OUT_BUFFER_LEN                                   \
       )
</code></pre>
      <pre class="doc-comment">/* Compression buffer holds both IN and OUT buffers, so should be size of the larger */</pre>

      <h4 id="MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT">Marco <span>MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT (1 << 0)
</code></pre>
      <pre class="doc-comment">/*
 * TLS extension flags (for extensions with outgoing ServerHello content
 * that need it (e.g. for RENEGOTIATION_INFO the server already knows because
 * of state of the renegotiation flag, so no indicator is required)
 */</pre>

      <h4 id="MBEDTLS_TLS_EXT_ECJPAKE_KKPP_OK">Marco <span>MBEDTLS_TLS_EXT_ECJPAKE_KKPP_OK</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_TLS_EXT_ECJPAKE_KKPP_OK                (1 << 1)
</code></pre>
      <pre class="doc-comment"></pre>
      <h3 id="functions">Functions</h3>
      

      <h4 id="mbedtls_ssl_sig_hash_set_add">Func <span>mbedtls_ssl_sig_hash_set_add</span></h4>
      <pre class="doc-declare"><code>void mbedtls_ssl_sig_hash_set_add( mbedtls_ssl_sig_hash_set_t *set,
                                  mbedtls_pk_type_t sig_alg,
                                  mbedtls_md_type_t md_alg );</code></pre>
      <pre class="doc-comment">/* Add a signature-hash-pair to a signature-hash set */</pre>

      <h4 id="mbedtls_ssl_sig_hash_set_const_hash">Func <span>mbedtls_ssl_sig_hash_set_const_hash</span></h4>
      <pre class="doc-declare"><code>void mbedtls_ssl_sig_hash_set_const_hash( mbedtls_ssl_sig_hash_set_t *set,
                                         mbedtls_md_type_t md_alg );</code></pre>
      <pre class="doc-comment">/* Allow exactly one hash algorithm for each signature. */</pre>

      <h4 id="mbedtls_ssl_transform_free">Func <span>mbedtls_ssl_transform_free</span></h4>
      <pre class="doc-declare"><code>void mbedtls_ssl_transform_free( mbedtls_ssl_transform *transform );</code></pre>
      <pre class="doc-comment">/**
 * \brief           Free referenced items in an SSL transform context and clear
 *                  memory
 *
 * \param transform SSL transform context
 */</pre>

      <h4 id="mbedtls_ssl_handshake_free">Func <span>mbedtls_ssl_handshake_free</span></h4>
      <pre class="doc-declare"><code>void mbedtls_ssl_handshake_free( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment">/**
 * \brief           Free referenced items in an SSL handshake context and clear
 *                  memory
 *
 * \param ssl       SSL context
 */</pre>

      <h4 id="mbedtls_ssl_handshake_client_step">Func <span>mbedtls_ssl_handshake_client_step</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_handshake_client_step( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_handshake_server_step">Func <span>mbedtls_ssl_handshake_server_step</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_handshake_server_step( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_handshake_wrapup">Func <span>mbedtls_ssl_handshake_wrapup</span></h4>
      <pre class="doc-declare"><code>void mbedtls_ssl_handshake_wrapup( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_send_fatal_handshake_failure">Func <span>mbedtls_ssl_send_fatal_handshake_failure</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_send_fatal_handshake_failure( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_reset_checksum">Func <span>mbedtls_ssl_reset_checksum</span></h4>
      <pre class="doc-declare"><code>void mbedtls_ssl_reset_checksum( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_derive_keys">Func <span>mbedtls_ssl_derive_keys</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_derive_keys( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_handle_message_type">Func <span>mbedtls_ssl_handle_message_type</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_handle_message_type( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_prepare_handshake_record">Func <span>mbedtls_ssl_prepare_handshake_record</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_prepare_handshake_record( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_update_handshake_status">Func <span>mbedtls_ssl_update_handshake_status</span></h4>
      <pre class="doc-declare"><code>void mbedtls_ssl_update_handshake_status( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_read_record">Func <span>mbedtls_ssl_read_record</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_read_record( mbedtls_ssl_context *ssl,
                            unsigned update_hs_digest );</code></pre>
      <pre class="doc-comment">/**
 * \brief       Update record layer
 *
 *              This function roughly separates the implementation
 *              of the logic of (D)TLS from the implementation
 *              of the secure transport.
 *
 * \param  ssl              The SSL context to use.
 * \param  update_hs_digest This indicates if the handshake digest
 *                          should be automatically updated in case
 *                          a handshake message is found.
 *
 * \return      0 or non-zero error code.
 *
 * \note        A clarification on what is called 'record layer' here
 *              is in order, as many sensible definitions are possible:
 *
 *              The record layer takes as input an untrusted underlying
 *              transport (stream or datagram) and transforms it into
 *              a serially multiplexed, secure transport, which
 *              conceptually provides the following:
 *
 *              (1) Three datagram based, content-agnostic transports
 *                  for handshake, alert and CCS messages.
 *              (2) One stream- or datagram-based transport
 *                  for application data.
 *              (3) Functionality for changing the underlying transform
 *                  securing the contents.
 *
 *              The interface to this functionality is given as follows:
 *
 *              a Updating
 *                [Currently implemented by mbedtls_ssl_read_record]
 *
 *                Check if and on which of the four 'ports' data is pending:
 *                Nothing, a controlling datagram of type (1), or application
 *                data (2). In any case data is present, internal buffers
 *                provide access to the data for the user to process it.
 *                Consumption of type (1) datagrams is done automatically
 *                on the next update, invalidating that the internal buffers
 *                for previous datagrams, while consumption of application
 *                data (2) is user-controlled.
 *
 *              b Reading of application data
 *                [Currently manual adaption of ssl->in_offt pointer]
 *
 *                As mentioned in the last paragraph, consumption of data
 *                is different from the automatic consumption of control
 *                datagrams (1) because application data is treated as a stream.
 *
 *              c Tracking availability of application data
 *                [Currently manually through decreasing ssl->in_msglen]
 *
 *                For efficiency and to retain datagram semantics for
 *                application data in case of DTLS, the record layer
 *                provides functionality for checking how much application
 *                data is still available in the internal buffer.
 *
 *              d Changing the transformation securing the communication.
 *
 *              Given an opaque implementation of the record layer in the
 *              above sense, it should be possible to implement the logic
 *              of (D)TLS on top of it without the need to know anything
 *              about the record layer's internals. This is done e.g.
 *              in all the handshake handling functions, and in the
 *              application data reading function mbedtls_ssl_read.
 *
 * \note        The above tries to give a conceptual picture of the
 *              record layer, but the current implementation deviates
 *              from it in some places. For example, our implementation of
 *              the update functionality through mbedtls_ssl_read_record
 *              discards datagrams depending on the current state, which
 *              wouldn't fall under the record layer's responsibility
 *              following the above definition.
 *
 */</pre>

      <h4 id="mbedtls_ssl_fetch_input">Func <span>mbedtls_ssl_fetch_input</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_fetch_input( mbedtls_ssl_context *ssl, size_t nb_want );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_write_handshake_msg">Func <span>mbedtls_ssl_write_handshake_msg</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_write_handshake_msg( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_write_record">Func <span>mbedtls_ssl_write_record</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_write_record( mbedtls_ssl_context *ssl, uint8_t force_flush );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_flush_output">Func <span>mbedtls_ssl_flush_output</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_flush_output( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_parse_certificate">Func <span>mbedtls_ssl_parse_certificate</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_parse_certificate( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_write_certificate">Func <span>mbedtls_ssl_write_certificate</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_write_certificate( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_parse_change_cipher_spec">Func <span>mbedtls_ssl_parse_change_cipher_spec</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_parse_change_cipher_spec( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_write_change_cipher_spec">Func <span>mbedtls_ssl_write_change_cipher_spec</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_write_change_cipher_spec( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_parse_finished">Func <span>mbedtls_ssl_parse_finished</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_parse_finished( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_write_finished">Func <span>mbedtls_ssl_write_finished</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_write_finished( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_optimize_checksum">Func <span>mbedtls_ssl_optimize_checksum</span></h4>
      <pre class="doc-declare"><code>void mbedtls_ssl_optimize_checksum( mbedtls_ssl_context *ssl,
                           const mbedtls_ssl_ciphersuite_t *ciphersuite_info );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_psk_derive_premaster">Func <span>mbedtls_ssl_psk_derive_premaster</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_psk_derive_premaster( mbedtls_ssl_context *ssl, mbedtls_key_exchange_type_t key_ex );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_set_calc_verify_md">Func <span>mbedtls_ssl_set_calc_verify_md</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_set_calc_verify_md( mbedtls_ssl_context *ssl, int md );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_check_curve">Func <span>mbedtls_ssl_check_curve</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_check_curve( const mbedtls_ssl_context *ssl, mbedtls_ecp_group_id grp_id );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_check_sig_hash">Func <span>mbedtls_ssl_check_sig_hash</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_check_sig_hash( const mbedtls_ssl_context *ssl,
                               mbedtls_md_type_t md );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_check_cert_usage">Func <span>mbedtls_ssl_check_cert_usage</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_check_cert_usage( const mbedtls_x509_crt *cert,
                         const mbedtls_ssl_ciphersuite_t *ciphersuite,
                         int cert_endpoint,
                         uint32_t *flags );</code></pre>
      <pre class="doc-comment">/*
 * Check usage of a certificate wrt extensions:
 * keyUsage, extendedKeyUsage (later), and nSCertType (later).
 *
 * Warning: cert_endpoint is the endpoint of the cert (ie, of our peer when we
 * check a cert we received from them)!
 *
 * Return 0 if everything is OK, -1 if not.
 */</pre>

      <h4 id="mbedtls_ssl_write_version">Func <span>mbedtls_ssl_write_version</span></h4>
      <pre class="doc-declare"><code>void mbedtls_ssl_write_version( int major, int minor, int transport,
                       unsigned char ver[2] );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_read_version">Func <span>mbedtls_ssl_read_version</span></h4>
      <pre class="doc-declare"><code>void mbedtls_ssl_read_version( int *major, int *minor, int transport,
                      const unsigned char ver[2] );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_send_flight_completed">Func <span>mbedtls_ssl_send_flight_completed</span></h4>
      <pre class="doc-declare"><code>void mbedtls_ssl_send_flight_completed( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_recv_flight_completed">Func <span>mbedtls_ssl_recv_flight_completed</span></h4>
      <pre class="doc-declare"><code>void mbedtls_ssl_recv_flight_completed( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_resend">Func <span>mbedtls_ssl_resend</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_resend( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_flight_transmit">Func <span>mbedtls_ssl_flight_transmit</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_flight_transmit( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_dtls_replay_check">Func <span>mbedtls_ssl_dtls_replay_check</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_dtls_replay_check( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_dtls_replay_update">Func <span>mbedtls_ssl_dtls_replay_update</span></h4>
      <pre class="doc-declare"><code>void mbedtls_ssl_dtls_replay_update( mbedtls_ssl_context *ssl );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="return">Func <span>return</span></h4>
      <pre class="doc-declare"><code>return( diff );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_get_key_exchange_md_ssl_tls">Func <span>mbedtls_ssl_get_key_exchange_md_ssl_tls</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_get_key_exchange_md_ssl_tls( mbedtls_ssl_context *ssl,
                                       unsigned char *output,
                                       unsigned char *data, size_t data_len );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_ssl_get_key_exchange_md_tls1_2">Func <span>mbedtls_ssl_get_key_exchange_md_tls1_2</span></h4>
      <pre class="doc-declare"><code>int mbedtls_ssl_get_key_exchange_md_tls1_2( mbedtls_ssl_context *ssl,
                                           unsigned char *hash, size_t *hashlen,
                                           unsigned char *data, size_t data_len,
                                           mbedtls_md_type_t md_alg );</code></pre>
      <pre class="doc-comment"></pre>
      <h3 id="vars">Vars</h3>
      

      <h4 id="ecrs_n">Variable <span>ecrs_n</span></h4>
      <pre class="doc-declare"><code>size_t ecrs_n;</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="out_msg_seq">Variable <span>out_msg_seq</span></h4>
      <pre class="doc-declare"><code>unsigned int out_msg_seq;</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="in_msg_seq">Variable <span>in_msg_seq</span></h4>
      <pre class="doc-declare"><code>unsigned int in_msg_seq;</code></pre>
      <pre class="doc-comment">/*!<  Outgoing handshake sequence number */</pre>

      <h4 id="char">Variable <span>char</span></h4>
      <pre class="doc-declare"><code>unsigned char *verify_cookie;</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="char">Variable <span>char</span></h4>
      <pre class="doc-declare"><code>unsigned char verify_cookie_len;</code></pre>
      <pre class="doc-comment">/*!<  Cli: HelloVerifyRequest cookie
                                              Srv: unused                    */</pre>

      <h4 id="retransmit_timeout">Variable <span>retransmit_timeout</span></h4>
      <pre class="doc-declare"><code>uint32_t retransmit_timeout;</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="char">Variable <span>char</span></h4>
      <pre class="doc-declare"><code>unsigned char retransmit_state;</code></pre>
      <pre class="doc-comment">/*!<  Current value of timeout       */</pre>

      <h4 id="flight">Variable <span>flight</span></h4>
      <pre class="doc-declare"><code>mbedtls_ssl_flight_item *flight;</code></pre>
      <pre class="doc-comment">/*!<  Retransmission state           */</pre>

      <h4 id="cur_msg">Variable <span>cur_msg</span></h4>
      <pre class="doc-declare"><code>mbedtls_ssl_flight_item *cur_msg;</code></pre>
      <pre class="doc-comment">/*!<  Current outgoing flight        */</pre>

      <h4 id="char">Variable <span>char</span></h4>
      <pre class="doc-declare"><code>unsigned char *cur_msg_p;</code></pre>
      <pre class="doc-comment">/*!<  Current message in flight      */</pre>

      <h4 id="in_flight_start_seq">Variable <span>in_flight_start_seq</span></h4>
      <pre class="doc-declare"><code>unsigned int in_flight_start_seq;</code></pre>
      <pre class="doc-comment">/*!<  Position in current message    */</pre>

      <h4 id="alt_transform_out">Variable <span>alt_transform_out</span></h4>
      <pre class="doc-declare"><code>mbedtls_ssl_transform *alt_transform_out;</code></pre>
      <pre class="doc-comment">/*!<  Minimum message sequence in the
                                              flight being received          */</pre>

      <h4 id="char">Variable <span>char</span></h4>
      <pre class="doc-declare"><code>unsigned char alt_out_ctr[8];</code></pre>
      <pre class="doc-comment">/*!<  Alternative transform for
                                              resending messages             */</pre>

      <h4 id="uint16_t">Variable <span>uint16_t</span></h4>
      <pre class="doc-declare"><code>uint16_t mtu;</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_md5_context">Variable <span>mbedtls_md5_context</span></h4>
      <pre class="doc-declare"><code>mbedtls_md5_context fin_md5;</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_sha1_context">Variable <span>mbedtls_sha1_context</span></h4>
      <pre class="doc-declare"><code>mbedtls_sha1_context fin_sha1;</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_sha256_context">Variable <span>mbedtls_sha256_context</span></h4>
      <pre class="doc-declare"><code>mbedtls_sha256_context fin_sha256;</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_sha512_context">Variable <span>mbedtls_sha512_context</span></h4>
      <pre class="doc-declare"><code>mbedtls_sha512_context fin_sha512;</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="update_checksum">Variable <span>update_checksum</span></h4>
      <pre class="doc-declare"><code>void (*update_checksum)(mbedtls_ssl_context *, const unsigned char *, size_t);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="calc_verify">Variable <span>calc_verify</span></h4>
      <pre class="doc-declare"><code>void (*calc_verify)(mbedtls_ssl_context *, unsigned char *);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="calc_finished">Variable <span>calc_finished</span></h4>
      <pre class="doc-declare"><code>void (*calc_finished)(mbedtls_ssl_context *, unsigned char *, int);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="tls_prf">Variable <span>tls_prf</span></h4>
      <pre class="doc-declare"><code>int (*tls_prf)(const unsigned char *, size_t, const char *,
                   const unsigned char *, size_t,
                   unsigned char *, size_t);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="pmslen">Variable <span>pmslen</span></h4>
      <pre class="doc-declare"><code>size_t pmslen;</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="char">Variable <span>char</span></h4>
      <pre class="doc-declare"><code>unsigned char randbytes[64];</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="char">Variable <span>char</span></h4>
      <pre class="doc-declare"><code>unsigned char premaster[MBEDTLS_PREMASTER_SIZE];</code></pre>
      <pre class="doc-comment">/*!<  random bytes            */</pre>

      <h4 id="resume">Variable <span>resume</span></h4>
      <pre class="doc-declare"><code>int resume;</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="max_major_ver">Variable <span>max_major_ver</span></h4>
      <pre class="doc-declare"><code>int max_major_ver;</code></pre>
      <pre class="doc-comment">/*!<  session resume indicator*/</pre>

      <h4 id="max_minor_ver">Variable <span>max_minor_ver</span></h4>
      <pre class="doc-declare"><code>int max_minor_ver;</code></pre>
      <pre class="doc-comment">/*!< max. major version client*/</pre>

      <h4 id="cli_exts">Variable <span>cli_exts</span></h4>
      <pre class="doc-declare"><code>int cli_exts;</code></pre>
      <pre class="doc-comment">/*!< max. minor version client*/</pre>

      <h4 id="new_session_ticket">Variable <span>new_session_ticket</span></h4>
      <pre class="doc-declare"><code>int new_session_ticket;</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="extended_ms">Variable <span>extended_ms</span></h4>
      <pre class="doc-declare"><code>int extended_ms;</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="async_in_progress">Variable <span>async_in_progress</span></h4>
      <pre class="doc-declare"><code>unsigned int async_in_progress : 1;</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="user_async_ctx">Variable <span>user_async_ctx</span></h4>
      <pre class="doc-declare"><code>void *user_async_ctx;</code></pre>
      <pre class="doc-comment">/** Asynchronous operation context. This field is meant for use by the
     * asynchronous operation callbacks (mbedtls_ssl_config::f_async_sign_start,
     * mbedtls_ssl_config::f_async_decrypt_start,
     * mbedtls_ssl_config::f_async_resume, mbedtls_ssl_config::f_async_cancel).
     * The library does not use it internally. */</pre>

      <h4 id="mbedtls_md_type_t">Variable <span>mbedtls_md_type_t</span></h4>
      <pre class="doc-declare"><code>mbedtls_md_type_t mbedtls_ssl_sig_hash_set_find( mbedtls_ssl_sig_hash_set_t *set,
                                                mbedtls_pk_type_t sig_alg );</code></pre>
      <pre class="doc-comment">/* Find an entry in a signature-hash set matching a given hash algorithm. */</pre>

      <h4 id="char">Variable <span>char</span></h4>
      <pre class="doc-declare"><code>unsigned char mbedtls_ssl_sig_from_pk( mbedtls_pk_context *pk );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="char">Variable <span>char</span></h4>
      <pre class="doc-declare"><code>unsigned char mbedtls_ssl_sig_from_pk_alg( mbedtls_pk_type_t type );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_pk_type_t">Variable <span>mbedtls_pk_type_t</span></h4>
      <pre class="doc-declare"><code>mbedtls_pk_type_t mbedtls_ssl_pk_alg_from_sig( unsigned char sig );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mbedtls_md_type_t">Variable <span>mbedtls_md_type_t</span></h4>
      <pre class="doc-declare"><code>mbedtls_md_type_t mbedtls_ssl_md_alg_from_hash( unsigned char hash );</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="char">Variable <span>char</span></h4>
      <pre class="doc-declare"><code>unsigned char mbedtls_ssl_hash_from_md_alg( int md );</code></pre>
      <pre class="doc-comment"></pre>
      <h3 id="consts">Consts</h3>
      
      <h3 id="types">Types</h3>
      
      <h3 id="typedefs">Typedefs</h3>
      

      <h4 id="mbedtls_ssl_hs_buffer">Typedef <span>mbedtls_ssl_hs_buffer</span></h4>
      <pre class="doc-declare"><code>typedef struct mbedtls_ssl_hs_buffer mbedtls_ssl_hs_buffer;
</code></pre>
      <pre class="doc-comment"></pre>
    </div>
  </body>
</html>
            